
<%@page import="org.jackysoft.util.*"%>
<%@ page contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib  uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib  uri="http://www.springframework.org/security/tags" prefix="sec" %>
<%@ taglib  uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<style>
.detail-panel {
	display:block;
}
</style>
<c:set var="ptn" value="######0.0000" />
<c:set var="iptn" value="######0" />
<table class="table table-hover table-bordered table-striped table-condensed ">
<thead>
  <tr>
    <th>
    <button class="btn btn-info"
      onclick="doPost('contract/contract!startquery')"
    >继续查询</button>
    </th>    
    <th></th>
    <th></th>
    <th></th>
  </tr>
  <tr>
   <c:forEach items="${quarters}" var="q">
    <th>${q.label}季度总量 </th>
   </c:forEach> 
    
  </tr>
</thead>
<%
      Quarters[] ms = Quarters.values();
      pageContext.setAttribute("quarters", ms);
     
   %>
<tbody>
  <c:forEach items="${pager.rows}" var="item">
   
   <tr class="success">
    
     <c:forEach items="${quarters}" var="q">
      

     <td>     
    
         <fmt:formatNumber value="${item[q.name]}" pattern="${ptn}"    />
        
    </td>
    </c:forEach>
   
   </tr>
   <tr>
    <c:forEach items="${quarters}" var="q">
     <td>
       <button type="button"
                 class="btn btn-success btn-mini"
             onclick="getCounter('${q.mySqlExpress}','exprid')"          
          >
                                      笔数
          </button>
          <span class="label label-inverse"></span>
     </td>
     </c:forEach>
   </tr>
   <tr>
    <td colspan="4">
    <form class="form-horizontal">
    		<input type="hidden" name="query.sqlId" value="statAllByDate"/>
    		<input type="hidden" name="query.resultCode" value="detailsOfQuarter"/>
    		<input type="hidden" name="query.state" value="START"/>
      		<input type="hidden" name="query.fields[0].name" value="YEAR(firedate)">
                <select name="query.fields[0].value" class="logic-control">
                    <option value="2013">2013</option>
                    <option value="2012">2012</option>
                </select>
                <input type="hidden" name="query.fields[0].outOpr" value="并且">

                <select name="query.fields[1].name" class="logic-control">
                    <option value="(a.jan+a.feb+a.mar)">一季度</option>
                    <option value="(a.apr+a.may+a.jun)">二季度</option>
                    <option value="(a.jul+a.aug+a.sep)">三季度</option>
                    <option value="(a.oct+a.nov+a.dec)">四季度</option>
                </select>
                <input type="hidden" name="query.fields[1].inOpr" value="大于">
                <input type="hidden" name="query.fields[1].value" value="0"/>
                <button 
         	  	   class="btn btn-inverse"
        		   type="button"
        		   onclick="toggleValidation(this)"
                    >季度明细
       			</button>
       			       	 
     </form>
    </td>
   </tr>   
  </c:forEach>
</tbody>
</table>
   <form id="cform">
  <input type="hidden" name="query.sqlId" value="counterByDate" />
  <input type="hidden" name="query.express" id="exprid"  />
  
</form>
<script type="text/javascript" src="scripts/apps/contract/query.js"></script>